package com.egg.ylt.adapter;

import android.content.Context;
import android.view.View;

import com.bumptech.glide.Glide;
import com.egg.ylt.R;
import com.egg.ylt.Utils.GlideRoundTransform;
import com.egg.ylt.Utils.StringUtil;
import com.egg.ylt.pojo.RelativeFamilyEntity;
import com.yonyou.framework.library.adapter.rv.CommonAdapter;
import com.yonyou.framework.library.adapter.rv.ViewHolder;

/**
 * Created by qiuzhenhuan on 2019/1/19.
 */

public class ADA_FamilyList extends CommonAdapter<RelativeFamilyEntity.ListBean> {


    private OnInviteListener onInviteListener;

    public ADA_FamilyList(Context context) {
        super(context);
    }

    @Override
    protected int itemLayoutId() {
        return R.layout.item_relative_family;
    }

    @Override
    protected void convert(ViewHolder holder, final RelativeFamilyEntity.ListBean listBean, int position) {

        holder.setText(R.id.tv_user_relate_name, StringUtil.get(listBean.getRelationshipName()));

        holder.setOnClickListener(R.id.tv_invite, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(onInviteListener!=null){
                    onInviteListener.onInviteClick(listBean);
                }
            }
        });

//        holder.setImageResource(R.id.iv_avator,)
    }


    public void setOnInviteListener(OnInviteListener onInviteListener) {
        this.onInviteListener = onInviteListener;
    }

    public interface OnInviteListener{
        void onInviteClick(RelativeFamilyEntity.ListBean familyEntity);
    }

}
